<?php

/**
 * Course form base class.
 *
 * @package    FinalsClub
 * @subpackage form
 * @author     Your name here
 * @version    SVN: $Id: sfPropelFormGeneratedTemplate.php 12815 2008-11-09 10:43:58Z fabien $
 */
class BaseCourseForm extends BaseFormPropel
{
  public function setup()
  {
    $this->setWidgets(array(
      'id'               => new sfWidgetFormInputHidden(),
      'user_id'          => new sfWidgetFormPropelChoice(array('model' => 'User', 'add_empty' => true)),
      'subject_id'       => new sfWidgetFormPropelChoice(array('model' => 'Subject', 'add_empty' => true)),
      'network_id'       => new sfWidgetFormInput(),
      'instructor_name'  => new sfWidgetFormInput(),
      'instructor_email' => new sfWidgetFormInput(),
      'section'          => new sfWidgetFormInput(),
      'name'             => new sfWidgetFormInput(),
      'description'      => new sfWidgetFormTextarea(),
      'tags'             => new sfWidgetFormInput(),
      'status'           => new sfWidgetFormInput(),
      'created_at'       => new sfWidgetFormDateTime(),
      'updated_at'       => new sfWidgetFormDateTime(),
    ));

    $this->setValidators(array(
      'id'               => new sfValidatorPropelChoice(array('model' => 'Course', 'column' => 'id', 'required' => false)),
      'user_id'          => new sfValidatorPropelChoice(array('model' => 'User', 'column' => 'id', 'required' => false)),
      'subject_id'       => new sfValidatorPropelChoice(array('model' => 'Subject', 'column' => 'id', 'required' => false)),
      'network_id'       => new sfValidatorInteger(array('required' => false)),
      'instructor_name'  => new sfValidatorString(array('max_length' => 60, 'required' => false)),
      'instructor_email' => new sfValidatorString(array('max_length' => 80, 'required' => false)),
      'section'          => new sfValidatorString(array('max_length' => 40, 'required' => false)),
      'name'             => new sfValidatorString(array('max_length' => 255, 'required' => false)),
      'description'      => new sfValidatorString(array('required' => false)),
      'tags'             => new sfValidatorString(array('max_length' => 255, 'required' => false)),
      'status'           => new sfValidatorInteger(array('required' => false)),
      'created_at'       => new sfValidatorDateTime(array('required' => false)),
      'updated_at'       => new sfValidatorDateTime(array('required' => false)),
    ));

    $this->widgetSchema->setNameFormat('course[%s]');

    $this->errorSchema = new sfValidatorErrorSchema($this->validatorSchema);

    parent::setup();
  }

  public function getModelName()
  {
    return 'Course';
  }


}
